Skip to content

Recover missing stream blocks through the getBlock Worker - #89

Merged
augustin-cheron merged 7 commits into
mainfrom
codex/getblock-stream-recovery-20261122
Nov 22, 2026
Merged

augustin-cheron merged 7 commits into
mainfrom
codex/getblock-stream-recovery-20261122

Conversation

@augustin-cheron

@augustin-cheron augustin-cheron commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

After a disconnect, the Rust stream consumer now recovers retained blocks through the getBlock Worker, verifies frame/object hashes and source, Bank, parent and cursor identities, commits each event with its cursor, and resumes the exact native sequence. Original control frames come from a bounded Foundation metadata plan. Expired history remains an explicit gap.

The public API at https://getblock.blockzilla.dev reads existing Foundation recent Compact V2 data first. A verified finalized miss can use the original R2 ranges and Foundation ID resolution. This adds no second block store, history-wide per-block index or production result RAM cache. The package retains the newer archive and consensus changes on main and includes the required SDK, consumer, read-only resolver and deployment tools.

The Unix socket cleanup guard now pins its original listener until cleanup finishes, preventing Linux inode reuse from deleting a replacement socket. The replacement regression checks its identity and connection.

The archive reprocessor now reads and preserves optional consensus fields with its existing size limits. It checks a parsed current prefix against the block index before selecting the format. Once that prefix matches, damaged or extra tail bytes cannot fall back to an older schema. The archive repair lock has explicit release when its owner ends, including when a duplicate file handle stays open. Format compatibility, index checks, field preservation and lock contention have regression tests.

CI now covers the standalone recovery crates, gateway and activation tools. The CI repair also formats existing Rust files and fixes local links. Default Gitleaks rules and full-history scanning remain enabled; reviewed metadata exceptions have positive and negative regression checks. See the per-file CI repair record.

Validation:

  • Current PR checks: stream, recovery, Worker, operations, documentation and secret scanning passed. Full Rust workspace tests passed. The broader Rust job failed at the separate user-program operational tool tests; its later archive checks did not run. See the CI result.
  • 162 local workerd/WASM checks; 130 Worker Rust tests; 30 native resolution tests.
  • 53 SDK, 54 consumer, 40 protocol, 15 decoder and 72 relay tests; gateway and activation checks passed.
  • The isolated live disconnect test recovered 15 blocks and 29 controls with no gaps or duplicates. The deployed client update recovered 8 blocks and 16 controls on its original database.
  • Publication record and fresh checks. Dated deployment receipts are separate from new branch checks. Ignored real-data checks are listed there. Private credentials and unrelated host inventories are omitted.

Add selected cost and recovery evidence, owner operation tools, and fresh merged-branch checks. Use canonical private directories in Unix socket fixtures so the checks also run on macOS. Preserve the original deployment identities and omit unrelated host inventories.
Keep all existing jobs and the full-history secret scan. Add standalone recovery coverage and tests that distinguish reviewed public metadata from credential fields. Apply Rustfmt, repair local links, and retain exact archive-boundary enforcement.
Pin the original Unix listener through cleanup so a replacement socket cannot reuse its inode. Record the existing decoder dependency in the consumer example lock, install Ripgrep for boundary checks, and remove stopword flakiness from generated secret-policy fixtures.
@augustin-cheron
augustin-cheron merged commit 05815eb into main Nov 22, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant